$(function(){
	$(".tipcell").click(function(){
		getSelectNode(this,".tipcell","selectedtip");
	});	
	$(".linkratio").click(function(){
		getSelectNode(this,".linkratio","selected");
	});
})
function getSelectNode(obj,selector,className){
		var parent = $(obj).parent();
		var cindex = parent.find(selector).index(parent.find(className));
		var newindex =  parent.find(selector).index($(obj));
		var nodes = parent.find(selector);
		var size = nodes.size();
		for(var i=0;i<size;i++){
			if(i == newindex){
				$(obj).addClass(className);
			}else{
				$(nodes[i]).removeClass(className);
			}
		}
}
 